def get_atom_list(atom_selection_str):
    selection_range = []
    sub_selections = atom_selection_str.split(',')
    for s in sub_selections:
        if '-' in s:
            l, u = s.split('-')
            selection_range.extend(range(int(l), int(u) + 1))
        else:
            selection_range.append(int(s))
    return selection_range


if __name__ == '__main__':
    print(get_atom_list('1-10, 12, 14-16'))
